#ifndef __TOCGHOUL_H__
#define __TOCGHOUL_H__

#include <GL/glut.h>
#include "tocUtil.h"

class TOCGhoul: public TOCBody {
public:
	TOCGhoul(void);
	TOCGhoul(TOCHuman *victim);
	~TOCGhoul();

	GLfloat getDistance(TOCGhoul *him);
	GLfloat getDistance(TOCHuman *him);
	void addNewGhoulNeighbor(TOCGhoul &newNeighbor);
	TOCHuman *doGhoulStuff(
		std::vector<TOCGhoul> neighbors,
		TOCHuman *potentialVictim);

private:
	std::vector<TOCGhoul> ghoulNeighbors;
	std::vector<TOCHuman> humanNeighbors;

	void _computeMove(void);
	void _drawMe();
	void initGhoul(void);

	bool moveToward(GLfloat x, GLfloat y);
	bool moveToward(TOCHuman *him);
	void _moveToward(GLfloat x, GLfloat y);

	static inline GLfloat _getDistance(GLfloat x1, GLfloat y1, 
					  GLfloat x2, GLfloat y2)
	{
		const GLfloat deltaX = x2 - x1;
		const GLfloat deltaY = y2 - y1;

		return (GLfloat)sqrt((deltaX * deltaX) + (deltaY * deltaY));
	}

};
#endif /* __TOCGHOUL_H__ */
